package com.nowcoder.community.util;

/**
 * @author tang
 * @create 2020-11-08
 */
public class RedisKeyUtil {
    private static final String SPLIT = ":";
    private static final String PREFIX_ENTITY_LIKE = "like:entity";
    private static final String PREFIX_USER_LIKE = "like:user";

    private static final String PREFIX_KAPTCHA = "kaptcha";
    private static final String PREFIX_TIKECT = "ticket";
    private static final String PREFIX_USER = "user";


    public static String getEntityLikeKey(int entityType,int EntityId){
        return PREFIX_ENTITY_LIKE+SPLIT+entityType+SPLIT+EntityId;
    }

    public static String getUserLikeKey(int userId){
        return PREFIX_USER_LIKE+SPLIT+userId;
    }

    public static  String getKaptchaKey(String owner){
        return PREFIX_KAPTCHA + SPLIT + owner;
    }
    public static  String getTicketKey(String ticket){
        return PREFIX_TIKECT + SPLIT + ticket;
    }
    public static String getUserKey(int userId){
        return PREFIX_USER + SPLIT + userId;
    }
}
